package main

import (
	"data_structure_and_algorithm/sort"
	"fmt"
)

func main() {
	//g := sort.NewDag(8)
	//g.AddEdge(2, 1)
	//g.AddEdge(3, 1)
	//g.AddEdge(7, 1)
	//g.AddEdge(4, 2)
	//g.AddEdge(5, 2)
	//g.AddEdge(8, 7)
	//g.AddEdge(1, 6)
	////data:=g.KhanSort()
	//data := g.DfsSort()
	//fmt.Println(data)
	//a := "ababaeabaacaaaaaddfdfdfdfdf"
	//b := "aca"
	//pos := strings.Kmp(b, a)
	//fmt.Println(pos)
	//tree := binarySearchTree.CreatTree([]int{14, 2, 5, 7, 23, 35, 12, 17, 31})
	//fmt.Println(binarySearchTree.LDR(tree))
	//fmt.Println(binarySearchTree.TreeHeight(tree))
	//g := graph.NewGraph(8)
	//g.AddVertex(1, 2)
	//g.AddVertex(1, 4)
	//g.AddVertex(2, 3)
	//g.AddVertex(2, 5)
	//g.AddVertex(4, 5)
	//g.AddVertex(3, 6)
	//g.AddVertex(5, 6)
	//g.AddVertex(5, 7)
	//g.AddVertex(6, 8)
	//g.AddVertex(7, 8)
	//g.Bfs(1, 7)
	//g.Dfs(1, 7)
	//ht := hashTable.NewNoLinkHashTable(2)
	//ht.HSet("data", 1)
	//fmt.Println(ht.HGet("data"))
	//myHeap := heap.NewHeap([]int{1, 2, 11, 3, 7, 8, 4, 5})
	//myHeap.SortHeap()
	//myHeap.HeapShow()
	//for myHeap.GetLength() > 0 {
	//	fmt.Println(myHeap.GetTopHeap().Value)
	//}
	//myLinkedList := linkedList.NewLinkedList([]interface{}{1, 21, 31, 51, 62, 2, 3, 42, 33, 12, 12})
	//myLinkedList.ShowLinkedList()
	//skipList.InitSkipList().Find(62)
	//myTrie := tire.CreateTree([]string{"how", "hi", "her", "hello", "so", "see"})
	//fmt.Println(myTrie.FindWord("how"))
	//fmt.Println(sort.QuickSort([]int{1, 9, 10, 30, 2, 5, 45, 8, 63, 234, 12},false))
	//fmt.Println(sort.HeapSort([]int{1, 9, 10, 30, 2, 5, 45, 8, 63, 234, 12},true))
	//fmt.Println(sort.BubbleSort([]int{1, 9, 10, 30, 2, 5, 45, 8, 63, 234, 12},true))
	//fmt.Println(sort.SelectSort([]int{1, 9, 10, 30, 2, 5, 45, 8, 63, 234, 12},true))
	//arr := make([]int, 1024*1024, 1024*1024)
	//for i := 0; i < 1024*1024; i++ {
	//	arr[i] = i + 1
	//}
	//id := search.BinarySearch(arr, 1000)
	//if id != -1 {
	//	fmt.Println(id, arr[id])
	//} else {
	//	fmt.Println("没有找到数据")
	//}
	r := new(sort.Radix)
	r.Init([]int{430, 12, 332, 167, 899, 998, 455, 6918, 571})
	r.Sort(false)
	fmt.Println(r.Display())
}
